<template>
  <el-collapse-transition>
    <div class="drop-down" v-show="headTransition" @mouseleave="changeHeadLeaveTransition">
      <el-card style="width: 100%">
        <div class="drop-down-item-list">
          <div class="drop-down-item" v-for="(item,index) in selectData.children">
            <div class="item-img">
              <img :src="item.picture">
            </div>
            <div class="item-text">
              <span>{{ item.name }}</span>
            </div>
          </div>
        </div>
      </el-card>
    </div>
  </el-collapse-transition>

</template>

<script setup lang="ts">
defineProps(['headTransition', 'selectData'])
const emit = defineEmits(['send-headTransition'])
let headTransitions: boolean;

function changeHeadLeaveTransition() {
  headTransitions = false;
  emit('send-headTransition', headTransitions)
}
</script>

<style scoped>
.drop-down {
  width: 100%;
  position: absolute;
  top: 11rem;
  left: 0;
  z-index: 999;
}


.item-img {
  width: 7rem;

}

.item-img img {
  width: 100%;
}

.drop-down-item-list {
  padding: 0 4rem;
  box-sizing: border-box;
  display: flex;
  text-align: center;
  gap: 4rem;
}

.item-text {
  font-size: 1.2rem;
  margin-top: 1rem;
}

.drop-down-item:hover .item-text span {
  cursor: pointer;
  color: var(--primary-color)
}

</style>